package com.longtop.leaning.ui;

import javax.microedition.lcdui.Choice;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.List;

import com.longtop.leaning.data.AppData;
import com.longtop.leaning.data.UIData;
import com.longtop.leaning.entity.FlightData;

public class FltDetailLit extends List implements CommandListener{
	
	public FltDetailLit() {
		super("航班详情", Choice.IMPLICIT, new String[]{}, null);
		FlightData flight = (FlightData)AppData.flights.elementAt(AppData.selectedIndex);
		if(flight != null){
			super.append("航班号："+flight.getFltno(), null);
			super.append("计划起飞时间："+flight.getFltdate().toString(), null);
		}
		
		super.addCommand(UIData.CMD_BACK);
		super.setCommandListener(this);
	}

	public void commandAction(Command c, Displayable d) {
		if (c == UIData.CMD_BACK) {
			UIData.display.setCurrent(new FltList());
		}
	}

}
